You'll need:
- PNPM — Node package manager. A superior NPM. Using this is required to develop on loca7, since the project has a pnpm-specific lockfile.
- Docker, or a MySQL server — Container management system-we'll only use it to install a MySQL server.
- Git — I hope you know what this is
- Mailhog — debug email client that catches all mail
git clone https://git.inpt.fr/inp-net/loca7
cd loca7
pnpm i
Create a new .env
file at the project's root, and fill it out with this:
DATABASE_URL=mysql://root:root@localhost:3306/loca7 # or whatever your connection string is.
# note that if you change any of the MAIL_* values, you have to change them in mailhog/
MAIL_HOST=127.0.0.1
MAIL_PORT=1025
MAIL_USER=test
MAIL_PASS=test
CHURROS_CLIENT_ID=... # see https://churros.inpt.fr/developers -- put http://localhost:5173/login/callback in the Allowed Redirect URIs
CHURROS_CLIENT_SECRET=...
OPENROUTESERVICE_KEY=... # see https://openrouteservice.org -- the API is completely free
- Install mysql (skip this if you already have a MySQL installation)
docker run --name loca7-mysql -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 --mount source=mysql,target=/var/lib/mysql -d mysql
- Create database & allow all hosts to access root user
$ docker exec -it loca7-mysql mysql -u root -p
Enter password: root
mysql> create database loca7;
mysql> update mysql.user set host='%' where host='localhost' and user='root';
mysql> flush privileges;
- Create tables
pnpm prisma migrate reset
- Seed with data (optional)
For now, contact me via email to obtain a zip file of seeding data. Then:
pnpm prisma db seed
- Launch the database (if it's not already up)
docker start loca7-mysql
- Launch the mailhog server
pnpm mailhog &
- Launch the SvelteKit server
pnpm dev
- Launch prisma studio
pnpm prisma studio
- The mailhog client is on
http://localhost:8025