You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ilmomasiina is the event registration system originally created by Athene, forked by Tietokilta and currently under heavy development for our new site. Once finished, it will be available for all organizations to use, along with migration tools from the Athene-made version.
3
+
Ilmomasiina is the event registration system originally created by Athene, forked by Tietokilta and currently under
4
+
heavy development for our new site. Once finished, it will be available for all organizations to use, along with
5
+
migration tools from the Athene-made version.
4
6
5
-
The latest development version is in the `dev` branch. **Please note that the code is currently in alpha phase.** It likely has major bugs, and easy migrations will not be provided between versions until we reach beta.
7
+
The latest development version is in the `dev` branch. **Please note that the code is currently in alpha phase.**
8
+
It likely has major bugs, and easy migrations will not be provided between versions until we reach beta.
6
9
7
10
## Contributing
8
11
9
-
Progress and planning is tracked in GitHub issues. Please see and update the [project board](https://github.com/Tietokilta/ilmomasiina/projects/1) for ongoing work.
12
+
Progress and planning is tracked in GitHub issues.
13
+
Please see and update the [project board](https://github.com/Tietokilta/ilmomasiina/projects/1) for ongoing work.
10
14
11
-
All help is appreciated. Please contact @PurkkaKoodari or another member of Tietokilta's Digitoimikunta if you wish to actively help with development – there are still major changes to be done that may conflict with yours. Start by reading the [docs](docs/README.md) to get familiar with the project.
15
+
All help is appreciated. Please contact @PurkkaKoodari or another member of Tietokilta's Digitoimikunta if you wish to
16
+
actively help with development – there are still major changes to be done that may conflict with yours.
17
+
Start by reading the [docs](docs/README.md) to get familiar with the project.
12
18
13
19
## Documentation
14
20
15
21
See the [docs](docs/README.md) folder.
16
22
17
23
## Requirements
18
24
19
-
- Node.js 14
20
-
- npm 6
21
-
- MySQL or MariaDB (latest, older supported versions unknown)
25
+
- If using Docker:
26
+
- Docker: 17.04.0+
27
+
- docker-compose or Compose V2 (included in the latest releases of docker-cli)
28
+
- For development, or if running without Docker:
29
+
- Node.js: 14+
30
+
- npm: 6+
22
31
23
-
Containerization for these is in progress.
32
+
To run the project (dev or production), only Docker and Docker Compose are required.
33
+
For actual development, you'll want to have Node.js and npm installed locally in order to manage dependencies.
24
34
25
35
<!--
26
-
## Using Docker container
27
-
In project root directory
28
-
```bash
29
-
docker-compose up
30
-
```
31
-
This should build and run the environment so that it is accesible at [localhost:3000](http://localhost:3000). You will need to create an `.env` file in project root (see [ENV.md](ENV.md)).
32
-
33
36
### Create fake data
34
-
Use `docker exec ilmomasiina_backend_1 npm run create-fake-data` to create some data to dockerized Ilmomasiina. The server does not like an empty database, so this is a really good idea to do when first starting the server.
37
+
Use `docker exec ilmomasiina_backend_1 npm run create-fake-data` to create some data to dockerized Ilmomasiina.
38
+
The server does not like an empty database, so this is a really good idea to do when first starting the server.
35
39
-->
40
+
41
+
<!--
36
42
## MySQL Setup
37
-
<!--Only follow this if you don't use the Docker container.-->
43
+
Only follow this if you don't use the Docker container.
38
44
39
45
### Mac
40
46
1. Install `mysql` (8.x) with Homebrew (https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e)
41
47
2. Start the mysql service with `brew services start mysql`
42
48
3. Open the mysql terminal with `mysql -u root`
43
-
4. In the mysql terminal, create a new user e.g. `CREATE USER 'juuso'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';`
44
-
5. Fix permissions (this is probably too permissive, but it works): `GRANT ALL PRIVILEGES ON *.* TO 'sampo'@'localhost' WITH GRANT OPTION;`
49
+
4. In the mysql terminal, create a new user e.g.
50
+
`CREATE USER 'juuso'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';`
51
+
5. Fix permissions (this is probably too permissive, but it works):
52
+
`GRANT ALL PRIVILEGES ON *.* TO 'sampo'@'localhost' WITH GRANT OPTION;`
45
53
6. Type `exit` to exit the mysql terminal, and sign in with your new user e.g. `mysql -u juuso -p password`
46
54
7. Create the `ilmomasiina` database with `CREATE DATABASE ilmomasiina;`
47
55
@@ -53,43 +61,72 @@ Use `docker exec ilmomasiina_backend_1 npm run create-fake-data` to create some
53
61
5. Fix permissions (this is probably too permissive, but it works): `GRANT ALL PRIVILEGES ON *.* TO 'sampo'@'localhost' WITH GRANT OPTION;`
54
62
6. Exit with `exit` and sign in with your new user e. g. `mysql -u juuso -p` (don't use `mysql -u juuso -p password`)
55
63
7. Follow Mac instructions step 6
64
+
-->
56
65
57
-
## Getting started
58
-
If you are using the Docker container, only follow step 1 as rest are automatically executed.
66
+
## Production setup
59
67
60
-
1. Create an `.env` file at the root of the project. For the contents of the .env file, check [ENV.MD](./ENV.MD)
61
-
2.`npm install`
62
-
3.**(IMPORTANT)**`npx lerna bootstrap`
63
-
4.`npm start`
68
+
TODO. (This file has lots of outdated information as comments.)
64
69
65
-
**Optional**: You can create mockup data for development by running `npm run create-fake-data`. During development, database can be resetted with `npm run reset-db`.
70
+
## For developers
66
71
67
-
### Troubleshooting (Ubuntu)
68
-
If `npm start` gives error `Error: You must provide a 'secret' in your authentication configuration`, it probably means that the `.env` file is not loaded correctly. A quick fix for this is to run `source .env`.
72
+
See the [documentation](docs/README.md) for more information.
69
73
70
-
##Mailgun setup
74
+
### Development setup using Docker Compose
71
75
72
-
Mailgun provides 10 000 free messages per month which is suitable for small projects. With minor changes sending mail could be also done via Sendgrid. Using your own mail server gets you labelled as spam pretty fast.
76
+
The entire development setup can be run within Docker using Docker Compose. The
77
+
[docker-compose dev setup](./docker-compose.yml) is located at the root of this repository, and contains a
78
+
pre-configured Postgres server, so an external database server is not required.
73
79
74
-
Add mailgun credentials to .env configuration.
80
+
1. Create a `.env` file at the root of this repository. You can copy [.env.example](./.env.example) to begin.
81
+
2. Go to the repository root and run `docker-compose up`. This builds the dev container and starts the frontend and
82
+
backend servers in parallel.
83
+
3. Access the app at <http://localhost:3000>.
75
84
76
-
### Create first admin user
85
+
Due to how the dev Docker is set up, you will need to rebuild the development image if you change the dependencies,
86
+
package.json or ESLint configs.
77
87
78
-
Add this line to .env configuration.
88
+
### Non-containerized development setup
79
89
90
+
You can also run the development server outside Docker.
91
+
92
+
1. Install Postgres or MySQL. You can use Docker for this. SQLite may also work. but is not currently tested.
93
+
2. Create a `.env` file at the root of this repository. You can copy [.env.example](./.env.example) to begin.
94
+
3. Run `npm install` to install Lerna and other global dependencies. The postinstall script should automatically run
95
+
`lerna bootstrap` to setup cross-dependencies between packages and install package dependencies.
96
+
4. Run `npm start`. This will start the frontend and backend dev servers in parallel.
97
+
- If you want cleaner output, you can run `npm start` separately in `packages/ilmomasiina-frontend` and
98
+
`packages/ilmomasiina-backend`.
99
+
- Currently, there is no way to run the Webpack development server directly within the backend process.
100
+
5. Access the app at <http://localhost:3000>.
101
+
102
+
<!-- TODO
103
+
### Creating first admin user
104
+
> By default, only logged-in admin users can create new admin users using the `/admin` endpoint.
105
+
> To create the first one, admin registration needs to be allowed.
106
+
107
+
Allow admin registration temporarily by adding this line to the `.env` file:
80
108
```
81
109
ADMIN_REGISTRATION_ALLOWED=true
82
110
```
83
111
84
-
Create new user with POST request.
112
+
If the Ilmomasiina was already running, restart it to apply the new env configuration.
85
113
114
+
Now, create a new user with POST request to `/admin`.
**Important**: Disallow admin user creation by removing the line.
122
+
**Important**: Disallow admin user creation by removing the previously added line from the `.env` file and restarting
123
+
the docker containers.
124
+
125
+
## Mailgun setup
126
+
127
+
Mailgun provides 10 000 free messages per month which is suitable for small projects. With minor changes sending mail could be also done via Sendgrid. Using your own mail server gets you labelled as spam pretty fast.
91
128
92
-
By default, only logged in admin users can create new admin users (via `/admin`).
0 commit comments