Plataforma de análise de discursos de personalidades públicas e combate a Fake News.
- Fork this repo and clone it locally:
git clone https://github.com/<your-username>/aletheia cd aletheia
- Startup Mongo DB via Docker and Ory Kratos:
docker-compose up -d
- Install packages:
yarn install
- To run in dev mode
yarn dev
- Access http://localhost:3000 in your browser.
TBD
The Platform requires a configuration file that can be used to customize aspects of the site depending on your needs.
cp config/localConfig.example.ts config/localConfig.ts
- Run seeder:
yarn seed
- Run the command below to update the users' affiliations:
./node_modules/.bin/ts-node ./server/scripts/updateAllUsersAppAffiliation.ts
- The build step should be run as follow:
yarn build
Execute the following command to start Ory Kratos using Docker Compose:
docker-compose up kratos kratos-migrate
You can also use the self-service-ui-node and maisluper images to have a better experience debugging Ory.
After starting the service, you can verify that it's running by accessing the admin panel:
- Open your web browser and go to http://localhost:4434/admin
- You should see a
404 page not found
message, which indicates that the server is running but the requested endpoint does not exist.
-
Configuring YAML Files Copy the Ory configurations from
config.example.yaml
to yourconfig.yaml
andconfig.seed.yaml
: -
- Replace the values for
url
,admin_url
,admin_endpoint
, andschema_id
with the appropriate values based on your setup inconfig.example.yaml
.
- Replace the values for
-
Configuring Environment Variables Copy the Ory configurations from
.env.example
to your.env
file: -
- Update the
NEXT_PUBLIC_ORY_SDK_URL
andORY_SDK_URL
variables as specified in the.env.example
file.
- Update the
Run the following command to seed the database with initial data:
yarn seed
Check if users were created successfully by accessing the identities page:
- Open http://localhost:4434/admin/identities in your browser.
- Create an account and a project on https://console.ory.sh/login.
- In Project settings, copy the SDK configuration URL and save it.
- On the same page, in API keys, create a new API key, copy it, and save it.
- Go to User Management in Identity Schema and click on Duplicate Identity Schema. Then, update the current schema to IdentitySchema.JSON and click Save after making the changes:
- Go to SDK Configuration url that you saved and add /schemas in the end of the url then copy the first id on the page and save it.
- If you want to check if it is the right id, at the same url paste after /schemas the /<schema_id> contaning the id that you just copied.
- First you gonna have to change the
authentication_type:
to ory on your config.yaml and config.seed.yaml. - Now take SDK Configuration url and paste on
url:
in both pages config.yaml, config.seed.yaml and onORY_SDK_URL=
in your .env too. - Now Paste the acess token that you saved on
access_token:
in your config.yaml and config.seed.yaml and onORY_ACCESS_TOKEN=
in your .env too. - Do the same as above, but now with the Schema ID you saved, and paste it into
schema_id
and onALETHEIA_SCHEMA_ID=
in .env.
- Go to User Interface on Ory Console and rewrite these fields: Login UI with http://localhost:3000/login and Settings UI with http://localhost:3000/profile.
- On ory console go into Two-Factor authentication section and enable TOTP Authenticator Apps, then save it.
- On mongoDB cloud go into Database > Your Cluster
- Once you select your cluster goes into the tab Search
- Here you can see all your created search indexes
- Click on CREATE INDEX button
- Select the Visual Editor configuration method and click in Next button
- Name your index, select the collection and click in Next button
- Create your own configurations by clicking on Refine Your Index
- Disable Dynamic Mapping and click in Add Field button in Fields Mapping
- Select your field name, disable dynamic mapping and click in Add Data Type button
- For personality search we select the name field
- For sentence search we select the content field
- For claim search we select the title and date field
- Select your data type and change the configs if you want to
- For claim title, personality name, and sentence content research, we select autocomplete data type, with 10 max grams and 3 min grams
- For claim date field, we select Date data type
- Add another data type if you want to click in the Add another data type icon
- Save your changes
- Review your new search index and click in Create Search Index button
- Replace your
connection_uri
with your MongoDB atlas connection URI in config.yaml - Bellow of
connection_uri
addatlas
field with a true boolean
- Create a GitLab account from the url: https://gitlab.com to be inserted into the project and have permission to access the closed tools
- Access Aletheia's GitLab account via the url: https://gitlab.com/aletheiafact/aletheia
- Click on the Deployments option
- Then click on the Feature Flag option
- Click on Configure, which is in front of the New Feature Flag button
- Appear the settings needed to be inserted into the .env e config.yaml
- The settings are the
api url
,instance id
andappName
- The
appName
that should be inserted is: Local, you must pay attention to the capital letter which makes a difference here API URL
: URL where the client (application) connects to get a list of feature flags.Instance ID
: Unique token that authorizes the retrieval of the feature flags.Application name
: The name of the environment the application runs in (not the name of the application itself).- Follow the example to put the variables in the right places.
docker-compose up -d localstack # Run in detached mode
docker-compose exec localstack awslocal s3 mb s3://aletheia