Sitemap

Day 37: CodeHost

1 min readOct 17, 2024

--

Today’s plan was to implement the feature to add environment variables for each project. I started with the frontend and added a new accordion below the customise build settings section, Environment variables.

I stored all the environments in a state and validated whether they were using restricted environment variable keys. As the project is built inside a docker container, certain environment variables are already used in the environment. To prevent conflicts, the user is not allowed to use certain environment keys.

Get Alwin Sunil’s stories in your inbox

Join Medium for free to get updates from this writer.

On creating the project all the environment variables are saved to the database in a new table EnvironmentVariables with key, value and projectId. This can be retrieved from the database in the container and used at the build time. Thus completing the implementation of the feature. But today due to lack of time I was able to implement this part, this will be worked on tomorrow.

Building the UI for the env section and logic to save this to database logic was done in about 3 hours. Currently, the code is not the best; it contains a lot of prop drilling and I plan to change this in the coming days if complexity increases to improve the readability.

That's all for today, Thank you for reading.

--

--

Alwin Sunil
Alwin Sunil

Written by Alwin Sunil

Fullstack Developer, CS Student at Kalvium. Around 2-3 hours a day, I work on my project CodeHost. Track my progress in my journal.