Coder Social home page Coder Social logo

octree-gva / civic-echo Goto Github PK

View Code? Open in Web Editor NEW
5.0 7.0 0.0 514 KB

Flexible survey webapp with multi-languages support

License: GNU Affero General Public License v3.0

Dockerfile 0.36% TypeScript 98.35% JavaScript 0.77% CSS 0.52%
civic-tech civictech government participation citizen-participation democracy govtech

civic-echo's Introduction

Civic Echo

Civic Echo is a lightweight app used for dynamic survey generation based on YAML files. Coupled with DeepL, it can handle multiple languages easily.

It is initiated for demaincestaujourdhui.online, led by Genève en Transition and Grand Genève en transition.

Civic Echo can store two kinds of data:

  • Responses data with no link to the respondent, stored in a Mongo database.
  • Respondents data who agreed to provide their information, stored in a Notion database

How does it work ?

1. Create questions in a YAML file for each language

Civic Echo uses a standardized YAML file format to describe questions and locales for a specific language. See langs directory for examples of YAML files.

We provide some tools to help you generate YAML files:

2. Provide the YAML files to the app

Put the YAML files in the app/langs directory and update the index.ts to add languages detection.

This step is a bit cumbersome. If you want to help us improve it, we are open to contributions.

app/
  ...
  langs/
    index.ts
    de.yaml
    en.yaml
    fr.yaml
    pt.yaml
# app/langs/index.ts
import fr from "./fr.yaml";
import en from "./en.yaml";
import de from "./de.yaml";
import pt from "./pt.yaml";

export const LANGS = ["fr", "en", "pt", "de"];

const langs: LangContent[] = [fr, en, de, pt];

export const getLangContent = (targetLang: string) => {
  return langs.find(lang => lang.lang === targetLang);
};

export default langs;

3. Adapt configuration

To store data, Civic Echo needs environment variables to connect to databases. Create an .env file in the app/ directory with following content:

MONGO_URL=mongodb://localhost:27017
NOTION_DBID=<Notion database ID to store respondents data>
NOTION_TOKEN=<Your Notion token with access to the db>

More documentation can be found in the app directory.

4. Run the app

yarn start # or 'npm start'

This command will install dependencies, build app and start it.

civic-echo's People

Contributors

5ika avatar cyberschnaps avatar simonmulquin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.