Create a .env file using the template provided
# Linux/MacOS/Other Unix-like OS
$ cp .env.template .env
# Windows
$ copy .env.template .env
and then fill out the sensitive details in the .env file.
Build and run the entire stack with
$ docker-compose up -d --build
Create the first superuser by running the following command and following the on-screen instructions
$ docker-compose exec backend python manage.py createsuperuser
By default the backend should be available at http://localhost/8000/api and the frontend at http://localhost:3000.
When running in development mode the application has some data pre-loaded as well as some users. With the following username-password pairs.
| username | password |
|---|---|
| MattiMeikalainen | password |
| TeuvoTestaaja | password |
First you need to create an .env.prod file and fill it up with the relevant settings. After that you can run
$ docker-compose -f docker-compose.prod.yml up -d --build
to have the application start in production mode.
Documentation for the REST Api is available at the /api/docs endpoint. Its accessible with a superuser account.
Admin page for the Django backend is available at the /api/admin/ endpoint.
The backend is built with Django using the Django Rest Framework library.
The tests are located in the tests/ directory of each app.
$ docker-compose exec backend python manage.py test
$ docker-compose exec backend python manage.py makemigrations
$ docker-compose exec backend python manage.py migrate
Migrations are also run when starting up the Django application.
The frontend is a fairly basic React+TypeScript application.
For faster development iterations it may be useful to run the development server without docker (while running the database and backend services with it, of course).
# only start up the Django and PostreSQL services with Docker
$ docker-compose up backend db
# install dependencies
$ npm install
# start up Node development server
$ npm start