This document is a brief explanation of your take home assignment. Before proceeding further, we’d like to thank you for time and patience during our hiring process.
This is a simple CRUD application. This monorepo contains an API and a frontend APP. Each directory has a simple Dockerfile. Your assignment is;
- Optimizing both Dockerfiles. For example change base images, reorganize steps etc.
- Update
APIDockerfile to run api. APIserving on port3000.- PostgreSQL and Redis server must be up and configured to run
API. Otherwise it will throws an error. - You can use
APPdevelopment server to test connection withAPI. APPdevelopment server serving on port3000.- Update
APPDockerfile to build application and serve static files andindex.htmlon any web server (nginx, Caddy etc.). - Create production ready docker-compose stack to run application. All services (api, app, database...) must be in this file.
A Ruby on Rails project depends on Redis and PostgreSQL. It accepts following environment variables;
DATABASE_HOSTdefauult:localhostDATABASE_PORTdefault:5432DATABASE_USERNAMEdefault:postgresDATABASE_PASSWORDdefault:''REDIS_URLhas no default value. Connection URL must useredisprotocol.REDIS_PASSWORDhas no default value.
After all connections established run rails db:create to initialize database. Run rails db:migrate db:seed to load database schemas.
API Project has no static files. To start application just use puma command.
Simple React frontend for API project. It accepts only one environment variable. See .env file.
To start development server use npm start. Create a production build to the build folder use npm build. Serve with any web server on port 80.
- Please DONT FORK THIS REPO. Just CLONE it.
- We cleaned commit history on purpose.
- Commit files progressively. Single commit history is negative aspect.
- Running API tests on build or deployment. (
rake testcommand) - Creating any CI/CD Pipeline (Github Actions, Gitlab CI, Travis, CircleCI etc.)
- Docker image sizes